package com.haoniu.module.service.impl;

import java.util.List;
import java.util.Map;

import com.haoniu.module.domain.dto.RoomVipDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haoniu.module.mapper.RoomMapper;
import com.haoniu.module.domain.database.Room;
import com.haoniu.module.service.RoomService;
import com.haoniu.common.support.Convert;

import javax.annotation.Resource;

/**
 * 房间 服务层实现
 * 
 * @author houyijun
 * @date 2019-01-24
 */
@Service
public class RoomServiceImpl implements RoomService
{
	@Resource
	private RoomMapper roomMapper;

	/**
     * 查询房间信息
     * 
     * @param id 房间ID
     * @return 房间信息
     */
    @Override
	public Room selectRoomById(Integer id) {
	    return roomMapper.selectRoomById(id);
	}
	
	/**
     * 查询房间列表
     * 
     * @param room 房间信息
     * @return 房间集合
     */
	@Override
	public List<Room> selectRoomList(Room room) {
	    return roomMapper.selectRoomList(room);
	}
	
    /**
     * 新增房间
     * 
     * @param room 房间信息
     * @return 结果
     */
	@Override
	public int insertRoom(Room room) {
	    return roomMapper.insertRoom(room);
	}
	
	/**
     * 修改房间
     * 
     * @param room 房间信息
     * @return 结果
     */
	@Override
	public int updateRoom(Room room) {
	    return roomMapper.updateRoom(room);
	}

	/**
     * 删除房间对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteRoomByIds(String ids) {
		return roomMapper.deleteRoomByIds(Convert.toStrArray(ids));
	}

	@Override
	public Room selectRoomByHxId(String huanxinGroupId) {
		return roomMapper.selectRoomByHxId(huanxinGroupId);
	}

	@Override
	public List<RoomVipDTO> getRoomVipList(Map<String, Object> map) {
		return roomMapper.getRoomVipList(map);
	}

	@Override
	public List<Room> findAllRoom() {
		return roomMapper.findAllRoom();
	}

	@Override
	public List<Integer> findRoomBossId(Integer roomId) {
		return roomMapper.findRoomBossId(roomId);
	}


}
